/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2025-10-07
 * Time: 23:03
 */
public class TestH2 {
    public static int removeElement(int[] num, int val) {
        int slow = 0;
        for(int fast = 0; fast < num.length; fast++) {
            if(num[fast] != val) {
                num[slow++] = num[fast];
            }
        }
        return slow;
    }

    public static void main(String[] args) {
        int[] num = {3,2,2,3};
        int ret = removeElement(num,3);
        System.out.println(ret);
    }
}
